package com.zjj.sc.helloworld.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.zjj.sc.helloworld.dao.UserRepository;
import com.zjj.sc.helloworld.dto.User;

@RestController
public class UserController {
	
	@Autowired
	UserRepository userRepository;
	
	@Value("${test.testUrl}")
	private String testUrl;
	
	@GetMapping("/{id}")
	public User findById(@PathVariable Long id) {
		User user = this.userRepository.findOne(id);
		
		System.out.println("testUrl : " + testUrl);
		
		return user;
	}
	

}
